package com.example.constant;

/**
 * @author zhexueqi
 * @ClassName RoleTypeEnum
 * @since 2025/4/8    19:22
 */
public enum RoleTypeEnum {

    ADMIN(0, "管理员", "admin"),
    EMPLOYEE(1, "员工", "employee"),
    BUREAU(2, "社保局", "bureau"),
    EMPLOYER(3, "雇主", "employer");

    private final Integer code;
    private final String desc;
    private final String type;

    RoleTypeEnum(Integer code, String desc, String type) {
        this.code = code;
        this.desc = desc;
        this.type = type;
    }

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getType() {
        return type;
    }

    public static RoleTypeEnum getByCode(Integer code) {
        for (RoleTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value;
            }
        }
        return null;
    }
}
